#include <stdio.h>
#include <libavutil/log.h>
#include <libavformat/avformat.h>

int main() {
    printf("Hello, World!\n");

    av_log_set_level(AV_LOG_DEBUG);

    av_log(NULL, AV_LOG_INFO, "hello world = %d\n", 1);

    AVIODirContext *ctx = NULL;

    int ret;

    ret = avio_open_dir(&ctx, "./", NULL);

    if (ret < 0) {
        av_log(NULL, AV_LOG_ERROR, "Cannot open dir %s\n", av_err2str(ret));
        return ret;
    }
    AVIODirEntry *entry = NULL;
    while (1) {
        ret = avio_read_dir(ctx, &entry);
        if (ret < 0) {
            av_log(NULL, AV_LOG_ERROR, "cannot read dir:%s\n", av_err2str(ret));
            return ret;
        }
        if (!entry) {
            break;
        }

        av_log(NULL, AV_LOG_INFO, "%12"PRId64" , %s \n", entry->size, entry->name);
    }

    AVStream *stream = NULL;
    AVFormatContext *context = NULL;
    AVPacket *packet = NULL;

    return 0;
}